package dao;

import BaseQuery.BaseQuery;
import Bean.PageBean;
import Jdbc.Employee;
import org.junit.Test;
import service.EmployeeService;

import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;

public class EmployeeServiceTest {
	@Test
	public void  testGetByPage() throws Exception {
		EmployeeServiceTest empserive=new EmployeeServiceTest();
		BaseQuery baseQuery=new BaseQuery();
		Map<String,Integer> map=new HashMap<>();
		System.out.println(map);
	}
	@Test
	public void testGetByPage1() throws Exception {
		EmployeeService empService = new EmployeeService();
		BaseQuery baseQuery = new BaseQuery();
		//分成三页
		//每页十条数据
		baseQuery.setPageNow(3);
		baseQuery.setPageCount(10);
		PageBean<Employee> pageBean = empService.getByPage(baseQuery);
		System.out.println(pageBean.getTotalRows());
		System.out.println(pageBean.getTotalPages());
		pageBean.getData().forEach(System.out::println);
	}

}
